/* 财务打款 */
function getDakuanxx(url){
		$.dpAjax({
		show:true,
 		url:url,
			data:{busiId:busiId},
			success: function(datas){
			 var data = datas.result;
			 if(data) {
				 /**
				  * 收支项目
				  */
				 var html = "";
				 var fundItems = data.fundItems;
				 if(fundItems && fundItems.length > 0) {
					 for(var i = 0; i < fundItems.length; i++) {
						 if(i % 7 == 0) {
							 html += '<li><table cellpadding="0" cellspacing="0" border="0" class="thead-table">';
							 html += '<thead class="thead-a"><tr><th></th><th>应收</th><th>实收</th></tr></thead><tbody class="tbody-a">';
						 }
						 var fundItem = fundItems[i];
						 html += '<tr><td>' + fundItem.name + '</td><td>' + showNumber(fundItem.feeCount) + '</td><td>' + showNumber(fundItem.remitCount) + '</td></tr>';
						 if(i % 7 == 6 || i == (fundItems.length - 1)) {
							 html += '</tbody></table></li>';
						 }
					 }
				 }
				 /**
				  * 收支总计
				  */
				 var fundTotal = data.fundTotal;
				 if(fundTotal) {
					 html += '<li style="clear:both;"><table cellpadding="0" cellspacing="0" border="0" class="thead-table"><thead class="thead-a"><tr><th></th><th>应收</th><th>实收</th></tr></thead><tbody class="tbody-a">'
					 html += '<tr><td><span style="color:red;">应收合计</span></td><td>' + showNumber(fundTotal.feeCount) + '</td><td>' + showNumber(fundTotal.remitCount) + '</td></tr>';
					 html + '</tbody></table></li>';
				 }
				 /**
				  * 其他突出显示收费项目
				  */
				 var fundItems_ = data.fundItems_;
				 for(var i = 0; i < fundItems_.length; i++) {
					 if(i == 0) {
						 html += '<li style="clear:both;"><table cellpadding="0" cellspacing="0" border="0" class="thead-table"><thead class="thead-a"><tr><th></th><th>应收</th><th>实收</th></tr></thead><tbody class="tbody-a">'
					 }
					 var fundItem_ = fundItems_[i];
					 html += '<tr><td>' + fundItem_.name + '</td><td>' + showNumber(fundItem_.feeCount) + '</td><td>' + showNumber(fundItem_.remitCount) + '</td></tr>';
					 if(i == fundItems_.length - 1) {
						 html + '</tbody></table></li>';
					 }
				 }
				 
				 /**
				  * 垫资返利
				  *//*
				 var cwRemitCar = data.cwRemitCar;
				 if(cwRemitCar) {
					 html += '<li style="clear:both;"><table cellpadding="0" cellspacing="0" border="0" class="thead-table"><tbody class="tbody-a">'
					 html += '<tr><td><span>垫资返利</span></td><td>' + showNumber(cwRemitCar.feePromotionReal) + '</td></tr>';
					 html + '</tbody></table></li>';
				 }*/
				 
				 $('#fundItems').html(html);
				 
				 
				 /*打款历史*/
				 var history = data.history;
				 if(history && history != '') {
					 $('#dakuan_history').text(history);
				 } else {
					 $('#dakuan_history').text("-");
				 }
				 /*车辆信息*/
				 var ywBusinessCar = data.ywBusinessCar;
				 if(ywBusinessCar){
					 $('#dakuan_carType').text(ywBusinessCar.carTypeDisplay);
					 $('#dakuan_carPlace').text(ywBusinessCar.carPlaceDisplay);
					 $('#dakuan_carBrand').text(ywBusinessCar.nameCarBrand);
					 $('#dakuan_carSeries').text(ywBusinessCar.nameCarSeries);
					 $('#dakuan_carModel').text(ywBusinessCar.nameCarModel);
					 $('#dakuan_price').text(showBigNumber(ywBusinessCar.price));
				 } else {
					 $('#dakuan_carType').text('-');
					 $('#dakuan_carPlace').text('-');
					 $('#dakuan_carBrand').text('-');
					 $('#dakuan_carSeries').text('-');
					 $('#dakuan_carModel').text('-');
					 $('#dakuan_price').text('-');
				 }
				 /*经销商信息*/
				 var dpBaseDealerInfo = data.dpBaseDealerInfo;
				 if(dpBaseDealerInfo){
					 $('#dakuan_dealerName').text(dpBaseDealerInfo.dealerName);
					 $('#dakuan_dealerLevel').text(dpBaseDealerInfo.dealerLevelDisplay);
				 } else {
					 $('#dakuan_dealerName').text('-');
					 $('#dakuan_dealerLevel').text('-');
				 }
				 /*贷款信息*/
				 var ywBusinessLoan = data.ywBusinessLoan;
				 if(ywBusinessLoan){
					 if(ywBusinessLoan.loanBank == 'TJICBC') {
						 $('.TJICBC').show();
					 }
					 $('#dakuan_loanBank').text(ywBusinessLoan.loanBankDisplay);
					 $('#dakuan_loanMonth').text(ywBusinessLoan.loanMonthDisplay);
					 $('#dakuan_companyRate').text(showNumber((ywBusinessLoan.companyRate && ywBusinessLoan.companyRate != '') ? ywBusinessLoan.companyRate * 100 : 0, 4));
					 $('#dakuan_loanAmount').text(showBigNumber(ywBusinessLoan.loanAmount));
				 } else {
					 $('#dakuan_loanBank').text('-');
					 $('#dakuan_loanMonth').text('-');
					 $('#dakuan_companyRate').text('-');
					 $('#dakuan_loanAmount').text('-'); 
				 }
				 /*按揭日报表*/
				var ywFees = data.ywFees;
			    if(ywFees) {
			    	//打款账号
					/*$('#dakuan_nameBankReceiver').text(ywFees.nameBankReceiver);
					$('#dakuan_accountNameReceiver').text(ywFees.accountNameReceiver);
					$('#dakuan_accounnNoReceiver').text(ywFees.accounnNoReceiver);*/
			    	$('#dakuan_typeBalance').text(ywFees.typeBalanceDisplay);
			    	
					$('#dakuan_rebateDealer').text(showNumber(ywFees.rebateDealer));
					$('#dakuan_rebateProvince').text(showNumber(ywFees.rebateProvince));
					$('#dakuan_rebateArea').text(showNumber(ywFees.rebateArea));
					$('#dakuan_rebateTypeDisplay').text(ywFees.rebateTypeDisplay);
			    } else {
			    	dakuan_clearFees();
			    }
			    /*打款详情*/
			    var cwRemitCar = data.cwRemitCar;
			    if(cwRemitCar){
			    	$('#dakuan_fundChannel').text(cwRemitCar.fundChannelDisplay);
			    	$('#dakuan_ccol1').text(cwRemitCar.ccol1Display); //天津中转账号
			    	$('#dakuan_nameBankReceiver').text(cwRemitCar.nameBankReceiver);
					$('#dakuan_accountNameReceiver').text(cwRemitCar.accountNameReceiver);
					$('#dakuan_accounnNoReceiver').text(cwRemitCar.accounnNoReceiver);
			    	
			    	$('#dakuan_amountRemit').text(showNumber(cwRemitCar.amountRemit));
					$('#dakuan_bankRemit').text(cwRemitCar.bankRemitDisplay);
					$('#dakuan_timeRemit').text(formateTime(cwRemitCar.timeRemit,'yyyy-MM-dd hh:mm'));
					$('#dakuan_timeArrive').text(formateTime(cwRemitCar.timeArrive,'yyyy-MM-dd hh:mm'));
					$('#dakuan_nameAuditor').text(cwRemitCar.nameAuditorDisplay);
					$('#dakuan_timeAudit').text(formateTime(cwRemitCar.timeAudit,'yyyy-MM-dd hh:mm'));
					$('#dakuan_financialRecordsNumber').text(cwRemitCar.financialRecordsNumber);
			    } else {
			    	dakuan_clearRemitCar();
			    }
			 }
         }
 	});
}

function dakuan_clearFees(){
	/*$('#dakuan_nameBankReceiver').text('-');
	$('#dakuan_accountNameReceiver').text('-');
	$('#dakuan_accounnNoReceiver').text('-');*/
	
	$('#dakuan_typeBalance').text('-');
	
	$('#dakuan_rebateDealer').text('-');
	$('#dakuan_rebateProvince').text('-');
	$('#dakuan_rebateArea').text('-');
	$('#dakuan_rebateTypeDisplay').text('-');
}

function dakuan_clearRemitCar(){
	$('#dakuan_fundChannel').text('-');
	$('#dakuan_ccol1').text("-");
	$('#dakuan_nameBankReceiver').text('-');
	$('#dakuan_accountNameReceiver').text('-');
	$('#dakuan_accounnNoReceiver').text('-');
	
	
	$('#dakuan_amountRemit').text('-');
	$('#dakuan_bankRemit').text('-');
	$('#dakuan_timeRemit').text('-');
	$('#dakuan_timeArrive').text('-');
	$('#dakuan_nameAuditor').text('-');
	$('#dakuan_timeAudit').text('-');
	$('#dakuan_financialRecordsNumber').text('-');
}